package io.renren.modules.eas.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.eas.dao.EasBasicTeacherDao;
import io.renren.modules.eas.entity.EasBasicTeacherEntity;
import io.renren.modules.eas.service.EasBasicTeacherService;


@Service("easBasicTeacherService")
public class EasBasicTeacherServiceImpl extends ServiceImpl<EasBasicTeacherDao, EasBasicTeacherEntity> implements EasBasicTeacherService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EasBasicTeacherEntity> page = this.page(
                new Query<EasBasicTeacherEntity>().getPage(params),
                new QueryWrapper<EasBasicTeacherEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils searchPage(Map<String, Object> params, Long search) {
        IPage<EasBasicTeacherEntity> page = this.page(
                new Query<EasBasicTeacherEntity>().getPage(params),
                new QueryWrapper<EasBasicTeacherEntity>().eq("user_id", search)
        );

        return new PageUtils(page);
    }

}